/* ============================================================
   SHIMAX AI - ENTERPRISE SPLIT AUTH (38% FORM / 62% CINEMATIC)
   ============================================================ */

/* ۱. ریست کامل بادی برای اتصال لب‌به‌لب */
body:has(.shimax-fullscreen-auth) {
    padding-top: 0 !important;
    overflow: hidden !important;
    height: 100vh !important;
}

body:has(.shimax-fullscreen-auth) .shimax-header,
body:has(.shimax-fullscreen-auth) footer,
body:has(.shimax-fullscreen-auth) .mobile-app-gateway {
    display: none !important;
}

.shimax-fullscreen-auth {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    overflow: hidden;
    background-color: var(--bg-page);
    z-index: 99999;
}

/* ─── ۱. پنل فرم لاگین (۳۸٪ عرض صفحه) ────────────────────────── */
.auth-panel-interactive {
    flex: 0 0 38%;
    width: 38%;
    max-width: 480px;
    min-width: 380px;
    height: 100%;
    background: var(--surface-card);
    z-index: 10;
    overflow-y: auto;
    padding: 2.5rem 2.25rem;
    box-shadow: -15px 0 35px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

[data-theme="dark"] .auth-panel-interactive {
    background: #090d16;
    box-shadow: -15px 0 45px rgba(0, 0, 0, 0.6);
}

.auth-panel-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-top-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.auth-return-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.08);
    transition: all 0.2s ease;
}

.auth-return-btn:hover {
    color: var(--emerald-500);
    background: rgba(16, 185, 129, 0.1);
    transform: translateX(4px);
}

.auth-form-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: auto 0;
    width: 100%;
}

.auth-hero-brand {
    position: relative;
    margin-bottom: 1.5rem;
}

.brand-capsule-logo {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #090d16;
    border: 2px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.brand-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 50%;
}

.brand-inner-glow {
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.45) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
    animation: authPulse 2.8s infinite alternate ease-in-out;
}

@keyframes authPulse {
    0% { transform: scale(0.95); opacity: 0.6; }
    100% { transform: scale(1.12); opacity: 1; }
}

.auth-header-headlines {
    margin-bottom: 1.75rem;
}

.auth-title-text {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.4px;
}

.emerald-text-glow {
    color: var(--emerald-500);
}

[data-theme="dark"] .emerald-text-glow {
    color: var(--emerald-400);
    text-shadow: 0 0 16px rgba(52, 211, 153, 0.4);
}

.auth-sub-caption {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto;
    font-weight: 500;
}

.auth-step-wrapper {
    width: 100%;
}

.auth-actions-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* دکمه‌های فرم */
.auth-btn {
    width: 100%;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: var(--surface-card);
    border: 1.5px solid var(--border-color);
    cursor: pointer;
    outline: none;
    box-sizing: border-box;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.btn-flex-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-title-label,
.auth-btn .btn-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-btn:hover {
    transform: translateY(-2px);
    border-color: var(--emerald-500);
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.16);
}

[data-theme="dark"] .auth-btn {
    background: #111827;
    border-color: rgba(75, 85, 99, 0.5);
}

[data-theme="dark"] .auth-btn:hover {
    background: #151f32;
    border-color: var(--emerald-400);
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.26);
}

.btn-submit-primary {
    background: var(--emerald-500) !important;
    border-color: var(--emerald-500) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px var(--emerald-glow) !important;
}

.btn-submit-primary .btn-text {
    color: #ffffff !important;
    font-weight: 800;
}

.btn-submit-primary:hover {
    background: var(--emerald-600) !important;
    box-shadow: 0 8px 25px var(--emerald-glow) !important;
}

/* خط جداکننده مدرن */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 0.6rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    width: 100%;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
    padding: 0 0.85rem;
    opacity: 0.85;
}

/* ساختار ورودی ایمیل و آیکون */
.auth-input-group {
    position: relative;
    width: 100%;
    margin-bottom: 0.25rem;
    box-sizing: border-box;
}

.auth-text-input {
    width: 100% !important;
    height: 52px !important;
    border-radius: 16px !important;
    border: 1.5px solid var(--border-color) !important;
    background: var(--surface-card) !important;
    padding: 0 2.75rem 0 1.25rem !important; /* فاصله از راست برای آیکون */
    font-size: 0.95rem !important;
    color: var(--text-primary) !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: all 0.25s ease !important;
}

[data-theme="dark"] .auth-text-input {
    background: #111827 !important;
    border-color: rgba(75, 85, 99, 0.5) !important;
    color: #ffffff !important;
}

.auth-text-input:focus {
    border-color: var(--emerald-500) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

.auth-input-icon {
    position: absolute;
    top: 50%;
    right: 1.15rem;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.15rem;
    pointer-events: none;
    z-index: 2;
}

/* ورودی کد ۶ رقمی OTP */
.otp-digits-input {
    padding: 0 !important;
    text-align: center !important;
    letter-spacing: 14px !important;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
}

.otp-instruction-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.emerald-highlight {
    color: var(--emerald-500);
    font-weight: 700;
}

.otp-actions-helper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.btn-link-action {
    background: none;
    border: none;
    color: var(--emerald-500);
    cursor: pointer;
    font-weight: 700;
    padding: 0;
}

.btn-link-action:hover {
    text-decoration: underline;
}

.timer-countdown {
    font-weight: 700;
    color: var(--text-primary);
}

/* چک‌باکس قوانین */
.auth-policy-checkbox-area {
    width: 100%;
}

.policy-checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    cursor: pointer;
    text-align: right;
    user-select: none;
}

.policy-checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark-box {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    background: var(--surface-card);
}

.checkmark-box i {
    font-size: 0.8rem;
    color: #ffffff;
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.2s ease;
}

.policy-checkbox-container input[type="checkbox"]:checked + .checkmark-box {
    background: var(--emerald-500);
    border-color: var(--emerald-500);
    box-shadow: 0 2px 8px var(--emerald-glow);
}

.policy-checkbox-container input[type="checkbox"]:checked + .checkmark-box i {
    opacity: 1;
    transform: scale(1);
}

.policy-agreement-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.emerald-link-term {
    color: var(--emerald-600);
    text-decoration: none;
    font-weight: 700;
}

[data-theme="dark"] .emerald-link-term {
    color: var(--emerald-400);
}

/* پیام‌های وضعیت */
.auth-alert-message {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.82rem;
    margin-bottom: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--emerald-500);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.auth-footer-brand {
    text-align: center;
}

.footer-shimax-tag {
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    opacity: 0.7;
    font-weight: 600;
}

/* ─── ۲. پنل ویدیویی سینمایی (۶۲٪ عرض صفحه) ─────────────────── */
.auth-panel-cinematic {
    flex: 1 1 62%;
    width: 62%;
    height: 100%;
    position: relative;
    background: #020617;
    overflow: hidden;
}

.video-sound-toggle-btn {
    position: absolute;
    top: 2rem;
    left: 2.5rem;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 30px;
    background: rgba(9, 13, 22, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #e2e8f0;
    cursor: pointer;
    outline: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.video-sound-toggle-btn:hover {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(52, 211, 153, 0.5);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.25);
}

.video-sound-toggle-btn i {
    font-size: 1.05rem;
    line-height: 1;
    color: #94a3b8;
}

.video-sound-toggle-btn .sound-icon-unmuted {
    display: none;
}

.video-sound-toggle-btn .sound-toggle-label {
    font-size: 0.8rem;
    font-weight: 700;
}

.video-sound-toggle-btn.has-sound {
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--emerald-400);
    color: #ffffff;
    box-shadow: 0 0 20px var(--emerald-glow);
}

.video-sound-toggle-btn.has-sound .sound-icon-muted {
    display: none;
}

.video-sound-toggle-btn.has-sound .sound-icon-unmuted {
    display: inline-block;
    color: #34d399;
}

.cinematic-carousel-engine {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide-item {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.carousel-slide-item.active {
    opacity: 1;
    visibility: visible;
}

.slide-video-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-vignette-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(2, 6, 23, 0.15) 0%,
        rgba(2, 6, 23, 0.35) 40%,
        rgba(2, 6, 23, 0.85) 80%,
        #020617 100%
    );
    pointer-events: none;
}

.slide-text-information {
    position: absolute;
    bottom: 5.5rem;
    right: 4rem;
    left: 4rem;
    z-index: 10;
    text-align: right;
    animation: textAppear 0.7s ease-out;
}

@keyframes textAppear {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-badge-meta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

.slide-headline {
    font-size: 2rem;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 0.65rem;
    letter-spacing: -0.4px;
    line-height: 1.3;
}

.slide-prompt-quote {
    font-size: 0.92rem;
    color: rgba(226, 232, 240, 0.85);
    font-weight: 500;
    line-height: 1.6;
    max-width: 580px;
}

.carousel-progress-bars {
    position: absolute;
    bottom: 2.75rem;
    left: 4rem;
    display: flex;
    gap: 10px;
    z-index: 20;
}

.progress-bar-segment {
    position: relative;
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    transition: width 0.3s ease;
}

.progress-fill-line {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0%;
    background: var(--emerald-500);
}

.progress-bar-segment.active {
    width: 70px;
}

/* ─── ریسپانسیو تبلت و موبایل ──────────────────────────────────── */
@media (max-width: 1024px) {
    .shimax-fullscreen-auth {
        flex-direction: column-reverse;
        position: relative;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    body:has(.shimax-fullscreen-auth) {
        overflow-y: auto !important;
        height: auto !important;
    }

    .auth-panel-interactive {
        width: 100%;
        max-width: 100%;
        flex: none;
        padding: 2.5rem 1.5rem;
    }

    .auth-panel-cinematic {
        width: 100%;
        height: 340px;
        flex: none;
    }

    .video-sound-toggle-btn {
        top: 1rem;
        left: 1rem;
        padding: 5px 12px;
    }

    .slide-text-information {
        bottom: 2rem;
        right: 1.5rem;
        left: 1.5rem;
    }

    .slide-headline {
        font-size: 1.35rem;
    }
}